package org.wmq.taskschedule.factory;

import org.springframework.beans.BeanUtils;
import org.wmq.taskschedule.algorithm.AlgorithmExecutor;
import org.wmq.taskschedule.algorithm.ImageRotationExecutor;
import org.wmq.taskschedule.biz.model.DO.Param;

/**
 * 图像旋转算法执行器工厂类
 * 实现AlgorithmExecutorFactory接口，用于创建ImageRotationExecutor实例
 */
public class ImageRotationExecutorFactory implements AlgorithmExecutorFactory {
    private static final ImageRotationExecutorFactory instance = new ImageRotationExecutorFactory();

    private ImageRotationExecutorFactory() {}
    
    /**
     * 获取工厂实例
     * @return ImageRotationExecutorFactory实例
     */
    public static ImageRotationExecutorFactory getInstance() {
        return instance;
    }
    
    @Override
    public AlgorithmExecutor getAlgorithmExecutor(Param param) {
        ImageRotationExecutor imageRotationExecutor = new ImageRotationExecutor();
        BeanUtils.copyProperties(param, imageRotationExecutor);
        return imageRotationExecutor;
    }
}